//
//  MKPageView.m
//  ManKeCartoon
//
//  Created by dllo on 15/10/21.
//  Copyright © 2015年 ManKe. All rights reserved.
//

#import "MKPageView.h"
#import "MKBaseHeader.h"
@implementation MKPageView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self createPage];
        
    }
    return self;
    
}

#pragma mark - 目录部分控件

-(void)createPage
{
    self.Line1  = [[UIView alloc] initWithFrame:CGRectMake(0 , 0, self.frame.size.width, 5)];
    [self.Line1 setBackgroundColor:[UIColor grayColor]];
    [self addSubview:self.Line1];
    
    self.MLImge = [[UIImageView alloc] initWithFrame:CGRectMake(10, self.Line1.frame.size.height + 10, 25, 25)];
    [self.MLImge setImage:[UIImage imageNamed:[NSString stringWithFormat:@"PAGE.png"]]];
    [self addSubview:self.MLImge];
    
    self.MLLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.MLImge.frame.size.width + self.MLImge.frame.origin.x + 5, self.MLImge.frame.origin.y, 40, 25)];
    [self.MLLabel setText:@"目录"];
    [self.MLLabel setFont:[UIFont systemFontOfSize:15]];
    [self.MLLabel setTextColor:[UIColor blackColor]];
    [self addSubview:self.MLLabel];
    
    self.TimeLabel = [[UILabel alloc] initWithFrame:CGRectMake( SCREEN_WIDTH - 140, self.MLLabel.frame.origin.y, 140, 25)];
    [self.TimeLabel setTextColor:[UIColor grayColor]];
    [self.TimeLabel setFont:[UIFont systemFontOfSize:12]];
    [self addSubview:self.TimeLabel];
    
    
    
    self.ALLButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_ALLButton setFrame:CGRectMake(20, self.TimeLabel.frame.origin.y + 130, SCREEN_WIDTH - 40, 35)];
    _ALLButton.layer.masksToBounds = YES;
    [_ALLButton.layer setCornerRadius:5];
    _ALLButton.layer.borderColor = [UIColor grayColor].CGColor;
    _ALLButton.layer.borderWidth = .5;
    [_ALLButton setTitle:@"查看全部章节" forState:UIControlStateNormal];
    [_ALLButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [self addSubview:_ALLButton];
    
    self.Line2 = [[UIView alloc] initWithFrame:CGRectMake(0, _ALLButton.frame.size.height + _ALLButton.frame.origin.y + 8, self.frame.size.width, 10)];
    [_Line2 setBackgroundColor:[UIColor grayColor]];
    [self addSubview:_Line2];
    
    self.TJImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, _Line2.frame.size.height + _Line2.frame.origin.y + 5, 25, 25)];
    [_TJImage setImage:[UIImage imageNamed:[NSString stringWithFormat:@"TJJJ.png"]]];
    [self addSubview:_TJImage];
    
    self.TJLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.TJImage.frame.size.width + 10 + 5, self.TJImage.frame.origin.y, 60, 25)];
    [_TJLabel setText:@"相关推荐"];
    [_TJLabel setTextColor:[UIColor blackColor]];
    [_TJLabel setFont:[UIFont systemFontOfSize:15]];
    [self addSubview:_TJLabel];
}
@end
